function KDSubmit () {
	var crkrdJjHoseName = $("#Jj_HoseName").val();
	var crkrdJjHouse = $("#Jj_area").val();
	var crkrdJjBand = $("#Jj_band").val();
	var crkrdJjName = $("#Jj_name").val();
	var crkrdJjValue = $("#Jj_prive").val();
	var crkrdUser = dataGet("userUuid");
	var crkrdRemarks = $("#Jj_remark").val();

	if(!crkrdJjHoseName){
		alert("请输入您的姓名！");
		return;
	}

	if(!crkrdJjHouse){
		alert("请输入您的手机号！");
		return;
	}

	if(!crkrdJjBand){
		alert("请输入您的小区名！");
		return;
	}

	if(!crkrdJjName){
		alert("请输入您的详细地址！");
		return;
	}

	if(!crkrdJjValue){
		alert("请输入您的回收时间！");
		return;
	}

	layer.open({type: 2});
	
	var data = "&crkrdJjArea="+crkrdJjHoseName+"&crkrdJjHouse="+crkrdJjHouse+"&crkrdJjBand="+crkrdJjBand
				+"&crkrdJjName="+crkrdJjName+"&crkrdJjValue="+crkrdJjValue
				+"&crkrdUser="+crkrdUser+"&crkrdRemarks="+crkrdRemarks + "&crkrdType=2" + "&uuids=" + picUuid;    //(1快递2回收)
	var url = urlfile + "coreBookingRecord/add/coreBookingRecord";
	ajaxTool("post",data,url,
		function error(XMLHttpRequest, textStatus, errorThrown,fnErr){
			alert("error:" + data);
			layer.closeAll();
		},
		function success(data){
			if(!data.success) {
				alert("您的提交已成功，管家将尽快与您联系");
				layer.closeAll();
			}else{
				alert("您的提交已成功，管家将尽快与您联系");
				$("#Jj_prive").val("");
				$("#Jj_remark").val("");
				layer.closeAll();
				
				dataSave("Jj_HoseName_hs",$("#Jj_HoseName").val());
				dataSave("Jj_area_hs",$("#Jj_area").val());
				dataSave("Jj_band_hs",$("#Jj_band").val());
				dataSave("Jj_name_hs",$("#Jj_name").val());
				dataSave("Jj_prive_hs",$("#Jj_prive").val());
			}
		}
	);
}

$(function() {
	upFile(true);

	if(dataGet("openId") == "") {
		dataSave("loginType", "huishou");
		nextView("../../../page/OAuthGetCodeLogin.html");
	}
	
	validSession();
	if(!dataGet('isLogined')){
		dataSave("openId", "");
		dataSave("loginType", "huishou");
		nextView("../../../page/OAuthGetCodeLogin.html");
		return;
	}

	$("#Jj_HoseName").val(dataGet('Jj_HoseName_hs'));
	$("#Jj_area").val(dataGet('Jj_area_hs'));
	$("#Jj_band").val(dataGet('Jj_band_hs'));
	$("#Jj_name").val(dataGet('Jj_name_hs'));
});

var picUuid="";
function upFile(isInit) {
	$('#uploadphoto').localResizeIMG({
      width: 300,
      quality: 1,
      success: function (result) {  
    	var submitData={
			"fileName":"a123.png","imgData":result.clearBase64,"cratmType":1, "cratmDir":"jgj/booking", 
		};
		$('#previewPic').attr("src",result.base64);
		$.ajax({
		   type: "POST",
		   url: urlfile + "coreAttachment/upload/stream",
		   data: submitData,
		   dataType:"json",
		   success: function(data){
			   	if(!data.success) {
					alert(data.errMsg);
				}else{
				   $('#loading').css("display","none");
				   picUuid = data.data;
				}
		   }, 
			complete :function(XMLHttpRequest, textStatus){
				$('#loading').css("display","none");
			},
			error:function(XMLHttpRequest, textStatus, errorThrown){ //上传失败 
			   $('#loading').css("display","none");
			   alert(XMLHttpRequest.status);
			   alert(XMLHttpRequest.readyState);
			   alert(textStatus);
			}
		}); 
      }
    });
}